//# sourceURL=http://uMapApp/Earth/DataSourceView/TerrainDataSourceView
define([
    "mhjs/mhjs",
    "uEarth/uEarth",
    "./DataSourceView"
], function (
    mhjs,
    uEarth,
    DataSourceView
) {

    function TerrainDataSourceView(option) {

        var _this = this;
        DataSourceView.call(_this, option);

    }

    var _class = TerrainDataSourceView;

    mhjs.Inherit(_class, DataSourceView);

    Object.defineProperties(_class.prototype, {
        "open" : {
            value: function () {

                var _this = this;

                if (!_this.isOpened) {

                    _this.layer.app.earth.terrainProvider = _this.terria;
                    _this.isOpened = true;

                    this.trigger("open");
                    this.trigger("toggle");
                }
            }
        },
        "close": {
            value: function () {

                var _this = this;

                _this.layer.app.earth.terrainProvider = new uEarth.EllipsoidTerrainProvider();
                _this.isOpened = false;

                if (_this.isOpened) {
                    this.trigger("close");
                    this.trigger("toggle");
                }
            }
        }
    });

    return _class;

});